// $codepro.audit.disable numericLiterals, variableShouldBeFinal
/* Copyright (c) 2011 Team A CS2340. All rights reserved.*/

/**
 * Make an user interface for doctor and nurse
 * 
 * @author Bruce
 * @version 1.0
 */
package edu.gatech.teama.doctorsoffice.client.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JButton;




import edu.gatech.teama.doctorsoffice.client.presenter.DoctorNurseMainPresenter;
import net.miginfocom.swing.MigLayout;
import javax.swing.border.SoftBevelBorder;
import javax.swing.border.BevelBorder;

/**
 * DoctorNurseMainPanel.java
 * @author unknown
 * @version 1.0
 */
public class DoctorNurseMainPanel extends JPanel {
	
	/**
	 * myPresenter
	 * 	 */
	private DoctorNurseMainPresenter myPresenter;

	/**
	 * btnLogOut 
	 */
	private JButton btnLogOut;

	/**
	 * make view only
	 * initialize all the fields
	 */
	public DoctorNurseMainPanel() { // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.audit.rule.effectivejava.constructorsOnlyInvokeFinalMethods
		setLayout(new BorderLayout(0, 0));
		myPresenter= new DoctorNurseMainPresenter();
		JPanel panel_1 = new JPanel();
		add(panel_1, BorderLayout.CENTER);
		panel_1.setLayout(new MigLayout("", "[grow][309px]", "[grow]"));
		
		JPanel userLookupPanel = new UserLookupPanel();
		userLookupPanel.setBorder(
				new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
		panel_1.add(userLookupPanel, "cell 0 0,grow");
		
		JPanel appointmentLookupPanel = new AppointmentLookupPanel();
		appointmentLookupPanel.setBorder(
				new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
		panel_1.add(appointmentLookupPanel, "cell 1 0,grow");
		
		JPanel panel_4 = new JPanel();
		add(panel_4, BorderLayout.SOUTH);
		
		btnLogOut = new JButton("Log Out");
		panel_4.add(btnLogOut);
					
		btnLogOut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				myPresenter.logOut();
			}
		});
		
		this.setMinimumSize(new Dimension(1024, 600));
	}

}
